#include "nscd_perif_init.h"



//--------------------------------------------------------------------------------
// DEBUG LED
void DebugLED_Init(void)
{

    /* Initialize Leds mounted on STM32 board */
    GPIO_InitTypeDef  GPIO_InitStructure;
    /* Initialize LED which connected to PC15, Enable the Clock*/
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
    /* Configure the GPIO_LED pin */
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOC, &GPIO_InitStructure);
}

void DebugLEDTogle(void)
{
	/* Toggle LEDs which connected to PC15*/
	GPIOC->ODR ^= GPIO_Pin_15;
}

void DebugLEDOn(void)
{
	/* Toggle LEDs which connected to PC15*/
	GPIOC->ODR |= GPIO_Pin_15;
}

//--------------------------------------------------------------------------------

// Init all selected peripherals
void NSCD_Init(void)
{
	// Uncomment peripherals to be used
	DebugLED_Init();
	Usart1_Init();
	Servo_Init();
}
